package com.moyu.Controller;


import com.moyu.Server.GoodsServer;
import com.moyu.pojo.Goods;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/goods")
public class GoodsController {

    @Autowired
    private GoodsServer goodsServer;



    @GetMapping("/findOne/{id}")
    public Goods findOne(@PathVariable("id") int id){
        final Goods goods = goodsServer.findOne(id);
        return  goods;
    }
}
